package springcloud.easybuy.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springcloud.easybuy.api.ProductCategoryServiceClient;
import springcloud.easybuy.entity.EasybuyProductCategory;

import java.util.List;

@RestController
public class ProductCategoryContoller {
    @Autowired
    private ProductCategoryServiceClient productCategoryServiceClient;

    @RequestMapping("/queryByParentId/{id}")
    public List<EasybuyProductCategory> queryAllProductCategory(@PathVariable("id") int id){
        return productCategoryServiceClient.queryAllProductCategory(id);
    }


    @RequestMapping("/queryAllProductCategory")
    public List<EasybuyProductCategory> queryAllProduct(){
        return productCategoryServiceClient.queryAllProduct() ;
    }


}
